home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / GAS211S2.ZIP / src / gas-211 / makefile.in next >
Makefile  |  1993-05-30  |  29KB  |  1,081 lines

  1. #
  2. # Makefile for directory with subdirs to build.
  3. #   Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation
  4. #
  5. # This file is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  16. #
  17.  
  18. srcdir = .
  19.  
  20. prefix = /usr/local
  21.  
  22. exec_prefix = $(prefix)
  23. bindir = $(exec_prefix)/bin
  24. libdir = $(exec_prefix)/lib
  25. tooldir = $(exec_prefix)/$(target)
  26.  
  27. program_transform_name =
  28.  
  29. datadir = $(prefix)/lib
  30. mandir = $(prefix)/man
  31. man1dir = $(mandir)/man1
  32. man2dir = $(mandir)/man2
  33. man3dir = $(mandir)/man3
  34. man4dir = $(mandir)/man4
  35. man5dir = $(mandir)/man5
  36. man6dir = $(mandir)/man6
  37. man7dir = $(mandir)/man7
  38. man8dir = $(mandir)/man8
  39. man9dir = $(mandir)/man9
  40. infodir = $(prefix)/info
  41. includedir = $(prefix)/include
  42. docdir = $(datadir)/doc
  43.  
  44. SHELL = /bin/sh
  45.  
  46. INSTALL = cp
  47. INSTALL_PROGRAM = $(INSTALL)
  48. INSTALL_DATA = $(INSTALL)
  49.  
  50. AS = as
  51. AR = ar
  52. AR_FLAGS = rc
  53. CC = cc
  54. CFLAGS = -g
  55. CXX = gcc
  56. CXXFLAGS = -g -O
  57. RANLIB = ranlib
  58. NM = nm
  59. MUNCH_NM = $(NM)
  60. GZIP = gzip
  61. COMPRESS = compress
  62.  
  63. BISON = bison -y
  64. LEX = `if [ -f $${rootme}/flex/flex ] ; \
  65.     then echo $${rootme}/flex/flex ; \
  66.     else echo flex ; fi`
  67.  
  68. MAKEINFO = `if [ -f $${rootme}/texinfo/makeinfo/makeinfo ] ; \
  69.     then echo $${rootme}/texinfo/makeinfo/makeinfo ; \
  70.     else echo makeinfo ; fi`
  71.  
  72. EXPECT = `if [ -f $${rootme}/expect/expect ] ; \
  73.     then echo $${rootme}/expect/expect ; \
  74.     else echo expect ; fi`
  75.  
  76. RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
  77.     then echo $${srcroot}/dejagnu/runtest ; \
  78.     else echo runtest ; fi`
  79.  
  80.  
  81. # libraries that may need to be augmented on a system-by-system basis
  82. X11_LIB = -lX11
  83.  
  84. # compilers to use to create programs which must be run in the build
  85. # environment.
  86. CC_FOR_BUILD = $(CC)
  87. CXX_FOR_BUILD = $(CXX)
  88.  
  89. SUBDIRS = "this is set via configure, don't edit this"
  90. OTHERS = 
  91.  
  92. ALL = all.normal
  93. INSTALL_TARGET = install.all
  94.  
  95. CC_FOR_TARGET = ` \
  96.   if [ -f $${rootme}/gcc/Makefile ] ; then \
  97.     echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
  98.   else \
  99.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  100.       echo $(CC); \
  101.     else \
  102.       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
  103.     fi; \
  104.   fi`
  105.  
  106.  
  107. CXX_FOR_TARGET = ` \
  108.   if [ -f $${rootme}/gcc/Makefile ] ; then \
  109.     echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
  110.   else \
  111.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  112.       echo $(CXX); \
  113.     else \
  114.       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
  115.     fi; \
  116.   fi`
  117.  
  118. AS_FOR_TARGET = ` \
  119.   if [ -f $${rootme}/gas/Makefile ] ; then \
  120.     echo $${rootme}/gas/as.new ; \
  121.   else \
  122.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  123.       echo $(AS); \
  124.     else \
  125.        t='$(program_transform_name)'; echo as | sed -e '' $$t ; \
  126.     fi; \
  127.   fi`
  128.  
  129. AR_FOR_TARGET = ` \
  130.   if [ -f $${rootme}/binutils/Makefile ] ; then \
  131.     echo $${rootme}/binutils/ar ; \
  132.   else \
  133.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  134.       echo $(AR); \
  135.     else \
  136.        t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \
  137.     fi; \
  138.   fi`
  139.  
  140. RANLIB_FOR_TARGET = ` \
  141.   if [ -f $${rootme}/binutils/Makefile ] ; then \
  142.     echo $${rootme}/binutils/ranlib ; \
  143.   else \
  144.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  145.       echo $(RANLIB); \
  146.     else \
  147.        t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \
  148.     fi; \
  149.   fi`
  150.  
  151. NM_FOR_TARGET = ` \
  152.   if [ -f $${rootme}/binutils/Makefile ] ; then \
  153.     echo $${rootme}/binutils/nm ; \
  154.   else \
  155.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  156.       echo $(NM); \
  157.     else \
  158.        t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
  159.     fi; \
  160.   fi`
  161.  
  162. # FIXME: This is badly named.
  163. XTRAFLAGS = ` \
  164.   if [ -f $${rootme}/gcc/Makefile ] ; then \
  165.     if [ -f $${rootme}/newlib/Makefile ] ; then \
  166.       echo -I$${rootme}/newlib/targ-include -I$${srcroot}/newlib/libc/include -I$${rootme}/gcc/include -nostdinc ; \
  167.     else \
  168.       echo -I$${rootme}/gcc/include ; \
  169.     fi ; \
  170.   else \
  171.      echo ; \
  172.   fi`
  173.  
  174. PRMS = all-prms
  175.  
  176. #### host and target specific makefile fragments come in here.
  177. ###
  178.  
  179. # Flags to pass down to all sub-makes.
  180. # Please keep these in alphabetical order.
  181. BASE_FLAGS_TO_PASS = \
  182.     "AR_FLAGS=$(AR_FLAGS)" \
  183.     "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
  184.     "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
  185.     "BISON=$(BISON)" \
  186.     "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
  187.     "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
  188.     "CFLAGS=$(CFLAGS)" \
  189.     "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
  190.     "CXXFLAGS=$(CXXFLAGS)" \
  191.     "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
  192.     'GCC_FOR_TARGET=$$(CC_FOR_TARGET)' \
  193.     "INSTALL=$(INSTALL)" \
  194.     "INSTALL_DATA=$(INSTALL_DATA)" \
  195.     "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  196.     "LDFLAGS=$(LDFLAGS)" \
  197.     "LEX=$(LEX)" \
  198.     "LOADLIBES=$(LOADLIBES)" \
  199.     "MAKEINFO=$(MAKEINFO)" \
  200.     "MUNCH_NM=$(MUNCH_NM)" \
  201.     "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
  202.     "PRMS=$(PRMS)" \
  203.     "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
  204.     "EXPECT=$(EXPECT)" \
  205.     "RUNTEST=$(RUNTEST)" \
  206.     "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
  207.     "XTRAFLAGS_FOR_TARGET=$(XTRAFLAGS)" \
  208.     "exec_prefix=$(exec_prefix)" \
  209.     "prefix=$(prefix)" \
  210.     "tooldir=$(tooldir)" 
  211.  
  212. # Flags to pass down to most sub-makes, in which we're building with
  213. # the host environment.
  214. # If any variables are added here, they must be added to do-*, below.
  215. EXTRA_HOST_FLAGS = \
  216.     'AR=$(AR)' \
  217.     'AS=$(AS)' \
  218.     'CC=$(CC)' \
  219.     'CXX=$(CXX)' \
  220.     'NM=$(NM)' \
  221.     'RANLIB=$(RANLIB)' \
  222.     'XTRAFLAGS='
  223.  
  224. FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
  225.  
  226. # Flags that are concerned with the location of the X11 include files
  227. # and library files
  228. X11_FLAGS_TO_PASS = \
  229.     "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
  230.     "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
  231.     "X11_LIB=$(X11_LIB)"
  232.  
  233. # Flags to pass down to makes which are built with the target environment.
  234. # The double $ decreases the length of the command line; the variables
  235. # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
  236. # If any variables are added here, they must be added to do-*, below.
  237. EXTRA_TARGET_FLAGS = \
  238.     'AR=$$(AR_FOR_TARGET)' \
  239.     'AS=$$(AS_FOR_TARGET)' \
  240.     'CC=$$(CC_FOR_TARGET)' \
  241.     'CXX=$$(CXX_FOR_TARGET)' \
  242.     'NM=$$(NM_FOR_TARGET)' \
  243.     'RANLIB=$$(RANLIB_FOR_TARGET)' \
  244.     'XTRAFLAGS=$$(XTRAFLAGS_FOR_TARGET)'
  245.  
  246. TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
  247.  
  248. # Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
  249. # unfortunately needs the native compiler and the target ar and
  250. # ranlib.
  251. # If any variables are added here, they must be added to do-*, below.
  252. # The HOST_* variables are a special case, which are used for the gcc
  253. # cross-building scheme.
  254. HOST_CC = $(CC_FOR_BUILD)
  255. HOST_PREFIX = 
  256. HOST_PREFIX_1 = loser-
  257. EXTRA_GCC_FLAGS = \
  258.     'AR=$$(AR_FOR_TARGET)' \
  259.     'AS=$(AS)' \
  260.     'CC=$(CC)' \
  261.     'CXX=$(CXX)' \
  262.     'HOST_CC=$(CC_FOR_BUILD)' \
  263.     'HOST_PREFIX=$(HOST_PREFIX)' \
  264.     'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
  265.     'NM=$(NM)' \
  266.     'RANLIB=$$(RANLIB_FOR_TARGET)' \
  267.     'XTRAFLAGS='
  268.  
  269. GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
  270.  
  271. # This is a list of the targets for all of the modules which are compiled
  272. # using $(FLAGS_TO_PASS).
  273. ALL_MODULES = \
  274.     all-autoconf \
  275.     all-bfd \
  276.     all-binutils \
  277.     all-byacc \
  278.     all-cvs \
  279.     all-dejagnu \
  280.     all-diff \
  281.     all-etc \
  282.     all-fileutils \
  283.     all-find \
  284.     all-flex \
  285.     all-gas \
  286.     all-gawk \
  287.     all-gdb \
  288.     all-gprof \
  289.     all-grep \
  290.     all-gzip \
  291.     all-hello \
  292.     all-indent \
  293.     all-ispell \
  294.     all-ld \
  295.     all-libiberty \
  296.     all-m4 \
  297.     all-make \
  298.     all-mmalloc \
  299.     all-opcodes \
  300.     all-patch \
  301.     all-prms \
  302.     all-rcs \
  303.     all-readline \
  304.     all-recode \
  305.     all-sed \
  306.     all-send-pr \
  307.     all-shellutils \
  308.     all-sim \
  309.     all-tar \
  310.     all-tcl \
  311.     all-texinfo \
  312.     all-textutils \
  313.     all-tgas \
  314.     all-time \
  315.     all-uudecode \
  316.     all-wdiff
  317.  
  318. # This is a list of the check targets for all of the modules which are
  319. # compiled using $(FLAGS_TO_PASS).
  320. CHECK_MODULES = \
  321.     check-autoconf \
  322.     check-bfd \
  323.     check-binutils \
  324.     check-byacc \
  325.     check-cvs \
  326.     check-dejagnu \
  327.     check-diff \
  328.     check-etc \
  329.     check-fileutils \
  330.     check-find \
  331.     check-flex \
  332.     check-gas \
  333.     check-gawk \
  334.     check-gdb \
  335.     check-gprof \
  336.     check-grep \
  337.     check-gzip \
  338.     check-hello \
  339.     check-indent \
  340.     check-ispell \
  341.     check-ld \
  342.     check-libiberty \
  343.     check-m4 \
  344.     check-make \
  345.     check-mmcheckoc \
  346.     check-opcodes \
  347.     check-patch \
  348.     check-prms \
  349.     check-rcs \
  350.     check-readline \
  351.     check-recode \
  352.     check-sed \
  353.     check-send-pr \
  354.     check-shellutils \
  355.     check-sim \
  356.     check-tar \
  357.     check-tcl \
  358.     check-texinfo \
  359.     check-textutils \
  360.     check-tgas \
  361.     check-time \
  362.     check-uudecode \
  363.     check-wdiff
  364.  
  365. # This is a list of the install targets for all of the modules which are
  366. # compiled using $(FLAGS_TO_PASS).
  367. INSTALL_MODULES = \
  368.     install-autoconf \
  369.     install-bfd \
  370.     install-binutils \
  371.     install-byacc \
  372.     install-cvs \
  373.     install-dejagnu \
  374.     install-diff \
  375.     install-etc \
  376.     install-fileutils \
  377.     install-find \
  378.     install-flex \
  379.     install-gas \
  380.     install-gawk \
  381.     install-gdb \
  382.     install-glob \
  383.     install-gprof \
  384.     install-grep \
  385.     install-gzip \
  386.     install-hello \
  387.     install-indent \
  388.     install-ispell \
  389.     install-ld \
  390.     install-libiberty \
  391.     install-m4 \
  392.     install-make \
  393.     install-mmalloc \
  394.     install-opcodes \
  395.     install-patch \
  396.     install-prms \
  397.     install-rcs \
  398.     install-readline \
  399.     install-recode \
  400.     install-sed \
  401.     install-send-pr \
  402.     install-shellutils \
  403.     install-sim \
  404.     install-tar \
  405.     install-tcl \
  406.     install-textutils \
  407.     install-tgas \
  408.     install-time \
  409.     install-uudecode \
  410.     install-wdiff
  411.  
  412. # This is a list of the targets for all of the modules which are compiled
  413. # using $(X11_FLAGS_TO_PASS).
  414. ALL_X11_MODULES = \
  415.     all-emacs \
  416.     all-expect \
  417.     all-tclX \
  418.     all-tk
  419.  
  420. # This is a list of the check targets for all of the modules which are
  421. # compiled using $(X11_FLAGS_TO_PASS).
  422. CHECK_X11_MODULES = \
  423.     check-emacs \
  424.     check-expect \
  425.     check-tclX \
  426.     check-tk
  427.  
  428. # This is a list of the install targets for all the modules which are
  429. # compiled using $(X11_FLAGS_TO_PASS).
  430. INSTALL_X11_MODULES = \
  431.     install-emacs \
  432.     install-expect \
  433.     install-tclX \
  434.     install-tk
  435.  
  436. # This is a list of the targets for all of the modules which are compiled
  437. # using $(TARGET_FLAGS_TO_PASS).
  438. ALL_TARGET_MODULES = \
  439.     all-libg++ \
  440.     all-newlib \
  441.     all-xiberty
  442.  
  443. # This is a list of the check targets for all of the modules which are
  444. # compiled using $(TARGET_FLAGS_TO_PASS).
  445. CHECK_TARGET_MODULES = \
  446.     check-libg++ \
  447.     check-newlib \
  448.     check-xiberty
  449.  
  450. # This is a list of the install targets for all of the modules which are
  451. # compiled using $(TARGET_FLAGS_TO_PASS).
  452. INSTALL_TARGET_MODULES = \
  453.     install-libg++ \
  454.     install-newlib \
  455.     install-xiberty
  456.  
  457. # This is a shell case of all modules which are compiled using
  458. # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
  459. TARGET_LIBS = libg++ | newlib | xiberty
  460.  
  461. # The first rule in the file had better be this one.  Don't put any above it.
  462. all: $(ALL)
  463. .PHONY: all
  464.  
  465. # The target built for a native build.
  466. .PHONY: all.normal
  467. all.normal: \
  468.     $(ALL_MODULES) \
  469.     $(ALL_TARGET_MODULES) \
  470.     $(ALL_X11_MODULES) \
  471.     all-gcc
  472.  
  473. # The target built for a cross build.
  474. .PHONY: all.cross
  475. all.cross: \
  476.     all-bfd \
  477.     all-binutils \
  478.     all-byacc \
  479.     all-dejagnu \
  480.     all-flex \
  481.     all-gas \
  482.     all-gcc \
  483.     all-gdb \
  484.     all-ld \
  485.     all-libiberty \
  486.     all-mmalloc \
  487.     all-opcodes \
  488.     all-readline \
  489.     all-sim \
  490.     $(ALL_TARGET_MODULES)
  491.  
  492. # Do a target for all the subdirectories.  A ``make do-X'' will do a
  493. # ``make X'' in all subdirectories (because, in general, there is a
  494. # dependency (below) of X upon do-X, a ``make X'' will also do this,
  495. # but it may do additional work as well).
  496. # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
  497. # because it is so large that it can easily overflow the command line
  498. # length limit on some systems.
  499. DO_X = \
  500.     do-clean \
  501.     do-distclean \
  502.     do-dvi \
  503.     do-info \
  504.     do-install-info \
  505.     do-installcheck \
  506.     do-mostlyclean \
  507.     do-realclean
  508. .PHONY: $(DO_X)
  509. $(DO_X):
  510.     @target=`echo $@ | sed -e 's/^do-//'`; \
  511.     rootme=`pwd`; export rootme; \
  512.     srcroot=`cd $(srcdir); pwd`; export srcroot; \
  513.     for i in $(SUBDIRS); do \
  514.       if [ -f ./$$i/Makefile ]; then \
  515.         case $$i in \
  516.         $(TARGET_LIBS) ) \
  517.           for flag in $(EXTRA_TARGET_FLAGS); do \
  518.         eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
  519.           done; \
  520.           ;; \
  521.         gcc) \
  522.           for flag in $(EXTRA_GCC_FLAGS); do \
  523.         eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
  524.           done; \
  525.           ;; \
  526.         *) \
  527.           for flag in $(EXTRA_HOST_FLAGS); do \
  528.         eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
  529.           done; \
  530.           ;; \
  531.         esac ; \
  532.         export AR AS CC CXX NM RANLIB XTRAFLAGS; \
  533.         if (cd ./$$i; \
  534.             $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
  535.             "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
  536.             "RANLIB=$${RANLIB}" "XTRAFLAGS=$${XTRAFLAGS}" \
  537.             $${target}); \
  538.         then true; else exit 1; fi; \
  539.       else true; fi; \
  540.     done
  541.  
  542. # Here are the targets which correspond to the do-X targets.
  543.  
  544. .PHONY: info installcheck dvi install-info
  545. .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
  546. info: do-info
  547. installcheck: do-installcheck
  548. dvi: do-dvi
  549.  
  550. install-info: install-info-dirs do-install-info dir.info
  551.     if [ -f dir.info ] ; then \
  552.       $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
  553.     else true ; fi
  554.  
  555. do-install-info: install-info-dirs
  556.  
  557. local-clean:
  558.     -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
  559.  
  560. local-distclean:
  561.     -rm -f Makefile config.status
  562.  
  563. clean: do-clean local-clean
  564. mostlyclean: do-mostlyclean local-clean
  565. distclean: do-distclean local-clean local-distclean
  566. realclean: do-realclean local-clean local-distclean
  567.  
  568. # Check target.
  569.  
  570. .PHONY: check
  571. check: $(CHECK_MODULES) \
  572.     $(CHECK_TARGET_MODULES) \
  573.     $(CHECK_X11_MODULES) \
  574.     check-gcc
  575.  
  576. # Installation targets.
  577.  
  578. .PHONY: install uninstall
  579. install: $(INSTALL_TARGET) 
  580.  
  581. uninstall:
  582.     @echo "the uninstall target is not supported in this tree"
  583.  
  584. .PHONY: install.all
  585. install.all: install-no-fixedincludes
  586.     @if [ -f ./gcc/Makefile ] ; then \
  587.         rootme=`pwd` ; export rootme ; \
  588.         (cd ./gcc; \
  589.         $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
  590.     else \
  591.         true ; \
  592.     fi
  593.  
  594. # install-no-fixedincludes is used because Cygnus can not distributed
  595. # the fixed header files.
  596. .PHONY: install-no-fixedincludes
  597. install-no-fixedincludes: \
  598.     install-dirs \
  599.     gcc-no-fixedincludes \
  600.     $(INSTALL_MODULES) \
  601.     $(INSTALL_TARGET_MODULES) \
  602.     $(INSTALL_X11_MODULES)
  603.  
  604. # Install the gcc headers files, but not the fixed include files,
  605. # which Cygnus is not allowed to distribute.  This rule is very
  606. # dependent on the workings of the gcc Makefile.in.
  607. .PHONY: gcc-no-fixedincludes
  608. gcc-no-fixedincludes:
  609.     @if [ -f ./gcc/Makefile ]; then \
  610.       rm -rf gcc/tmp-include; \
  611.       mv gcc/include gcc/tmp-include 2>/dev/null; \
  612.       mkdir gcc/include; \
  613.       cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
  614.       touch gcc/stmp-fixinc; \
  615.       rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
  616.       rootme=`pwd`; export rootme; \
  617.       srcroot=`cd $(srcdir); pwd` ; export srcroot; \
  618.       (cd ./gcc; \
  619.        $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
  620.       rm -rf gcc/include; \
  621.       mv gcc/tmp-include gcc/include 2>/dev/null; \
  622.     else true; fi
  623.  
  624. .PHONY: install.cross
  625. install.cross: \
  626.     install-dirs \
  627.         install-binutils \
  628.     install-byacc \
  629.     install-dejagnu \
  630.     install-etc \
  631.     install-flex \
  632.     install-gas \
  633.     install-gcc \
  634.     install-gdb \
  635.         install-glob \
  636.         install-ld \
  637.     install-libiberty \
  638.     install-mmalloc \
  639.     install-opcodes \
  640.     install-readline \
  641.     $(INSTALL_TARGET_MODULES)
  642.  
  643. # This rule is used to build the modules which use FLAGS_TO_PASS.  To
  644. # build a target all-X means to cd to X and make all.
  645. # all-glob is handled specially because it doesn't actually build.
  646. .PHONY: $(ALL_MODULES) all-glob
  647. $(ALL_MODULES) all-glob:
  648.     @dir=`echo $@ | sed -e 's/all-//'`; \
  649.     if [ -f ./$${dir}/Makefile ] ; then \
  650.       rootme=`pwd`; export rootme; \
  651.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  652.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
  653.     else \
  654.       true; \
  655.     fi
  656.  
  657. # This rule is used to check the modules which use FLAGS_TO_PASS.  To
  658. # build a target check-X means to cd to X and make all.
  659. .PHONY: $(CHECK_MODULES) 
  660. $(CHECK_MODULES):
  661.     @dir=`echo $@ | sed -e 's/check-//'`; \
  662.     if [ -f ./$${dir}/Makefile ] ; then \
  663.       rootme=`pwd`; export rootme; \
  664.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  665.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
  666.     else \
  667.       true; \
  668.     fi
  669.  
  670. # This rule is used to install the modules which use FLAGS_TO_PASS.
  671. # To build a target install-X means to cd to X and make install.
  672. .PHONY: $(INSTALL_MODULES)
  673. $(INSTALL_MODULES): install-dirs
  674.     @dir=`echo $@ | sed -e 's/install-//'`; \
  675.     if [ -f ./$${dir}/Makefile ] ; then \
  676.       rootme=`pwd`; export rootme; \
  677.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  678.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
  679.     else \
  680.       true; \
  681.     fi
  682.  
  683. # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
  684. # To build a target all-X means to cd to X and make all.
  685. .PHONY: $(ALL_TARGET_MODULES)
  686. $(ALL_TARGET_MODULES):
  687.     @dir=`echo $@ | sed -e 's/all-//'`; \
  688.     if [ -f ./$${dir}/Makefile ] ; then \
  689.       rootme=`pwd`; export rootme; \
  690.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  691.       (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
  692.     else \
  693.       true; \
  694.     fi
  695.  
  696. # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
  697. # To build a target install-X means to cd to X and make install.
  698. .PHONY: $(CHECK_TARGET_MODULES)
  699. $(CHECK_TARGET_MODULES):
  700.     @dir=`echo $@ | sed -e 's/check-//'`; \
  701.     if [ -f ./$${dir}/Makefile ] ; then \
  702.       rootme=`pwd`; export rootme; \
  703.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  704.       (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
  705.     else \
  706.       true; \
  707.     fi
  708.  
  709. # This rule is used to install the modules which use
  710. # TARGET_FLAGS_TO_PASS.  To build a target install-X means to cd to X
  711. # and make install.
  712. .PHONY: $(INSTALL_TARGET_MODULES)
  713. $(INSTALL_TARGET_MODULES): install-dirs
  714.     @dir=`echo $@ | sed -e 's/install-//'`; \
  715.     if [ -f ./$${dir}/Makefile ] ; then \
  716.       rootme=`pwd`; export rootme; \
  717.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  718.       (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
  719.     else \
  720.       true; \
  721.     fi
  722.  
  723. # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
  724. # To build a target all-X means to cd to X and make all.
  725. .PHONY: $(ALL_X11_MODULES)
  726. $(ALL_X11_MODULES):
  727.     @dir=`echo $@ | sed -e 's/all-//'`; \
  728.     if [ -f ./$${dir}/Makefile ] ; then \
  729.       rootme=`pwd`; export rootme; \
  730.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  731.       (cd $${dir}; \
  732.        $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
  733.     else \
  734.       true; \
  735.     fi
  736.  
  737. # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
  738. # To build a target check-X means to cd to X and make all.
  739. .PHONY: $(CHECK_X11_MODULES)
  740. $(CHECK_X11_MODULES):
  741.     @dir=`echo $@ | sed -e 's/check-//'`; \
  742.     if [ -f ./$${dir}/Makefile ] ; then \
  743.       rootme=`pwd`; export rootme; \
  744.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  745.       (cd $${dir}; \
  746.        $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
  747.     else \
  748.       true; \
  749.     fi
  750.  
  751. # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
  752. # To build a target install-X means to cd to X and make install.
  753. .PHONY: $(INSTALL_X11_MODULES)
  754. $(INSTALL_X11_MODULES):
  755.     @dir=`echo $@ | sed -e 's/install-//'`; \
  756.     if [ -f ./$${dir}/Makefile ] ; then \
  757.       rootme=`pwd`; export rootme; \
  758.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  759.       (cd $${dir}; \
  760.        $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
  761.     else \
  762.       true; \
  763.     fi
  764.  
  765. # gcc is the only module which uses GCC_FLAGS_TO_PASS.
  766. .PHONY: all-gcc
  767. all-gcc:
  768.     @if [ -f ./gcc/Makefile ] ; then \
  769.       rootme=`pwd`; export rootme; \
  770.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  771.       (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
  772.     else \
  773.       true; \
  774.     fi
  775.  
  776. .PHONY: check-gcc
  777. check-gcc:
  778.     @if [ -f ./gcc/Makefile ] ; then \
  779.       rootme=`pwd`; export rootme; \
  780.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  781.       (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
  782.     else \
  783.       true; \
  784.     fi
  785.  
  786. .PHONY: install-gcc
  787. install-gcc:
  788.     @if [ -f ./gcc/Makefile ] ; then \
  789.       rootme=`pwd`; export rootme; \
  790.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  791.       (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
  792.     else \
  793.       true; \
  794.     fi
  795.  
  796. # This is a list of inter-dependencies among modules.
  797. all-autoconf:
  798. all-bfd:
  799. all-binutils: all-libiberty all-opcodes all-bfd all-flex
  800. all-byacc:
  801. all-cvs:
  802. all-dejagnu:
  803. all-diff: all-libiberty
  804. all-emacs:
  805. all-etc:
  806. all-expect: all-tcl
  807. all-fileutils:
  808. all-find:
  809. all-flex: all-libiberty all-byacc
  810. all-gas: all-libiberty all-opcodes all-bfd
  811. all-gawk:
  812. all-gcc: all-libiberty all-byacc all-binutils all-gas
  813. all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc all-sim
  814. all-glob:
  815. all-gprof: all-libiberty all-bfd
  816. all-grep:
  817. all-gzip: all-libiberty
  818. all-hello: all-libiberty
  819. all-indent:
  820. all-ispell: all-emacs
  821. all-ld: all-libiberty all-bfd all-byacc all-flex
  822. all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib
  823. all-libiberty:
  824. all-m4: all-libiberty
  825. all-make: all-libiberty
  826. all-mmalloc:
  827. all-newlib: all-binutils all-gas all-gcc
  828. all-opcodes:
  829. all-patch:
  830. all-prms:
  831. all-rcs:
  832. all-readline:
  833. all-recode: all-libiberty
  834. all-sed:
  835. all-send-pr:
  836. all-shellutils:
  837. all-sim: all-libiberty all-bfd
  838. all-tar: all-libiberty
  839. all-tcl:
  840. all-tclX: all-tcl all-tk
  841. all-tk: all-tcl
  842. all-texinfo: all-libiberty
  843. all-textutils:
  844. all-tgas: all-libiberty all-bfd
  845. all-time:
  846. all-wdiff:
  847. all-uudecode: all-libiberty
  848. all-xiberty: all-gcc all-newlib
  849.  
  850. ### other supporting targets
  851.  
  852. MAKEDIRS= \
  853.     $(prefix) \
  854.     $(exec_prefix) \
  855.     $(tooldir)
  856.  
  857. .PHONY: install-dirs
  858. install-dirs:
  859.     @for i in $(MAKEDIRS) ; do \
  860.         echo Making $$i... ; \
  861.         parent=`echo $$i|sed -e 's@/[^/]*$$@@'`; \
  862.         if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
  863.         if [ ! -d $$i ] ; then \
  864.             if mkdir $$i ; then \
  865.                 true ; \
  866.             else \
  867.                 exit 1 ; \
  868.             fi ; \
  869.         else \
  870.             true ; \
  871.         fi ; \
  872.     done
  873.  
  874. .PHONY: install-info-dirs 
  875. install-info-dirs:
  876.     if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; fi
  877.     -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
  878.     if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
  879.     -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
  880.  
  881. dir.info: do-install-info
  882.     if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
  883.       $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
  884.       mv -f dir.info.new dir.info ; \
  885.     else true ; \
  886.     fi
  887.  
  888. dist:
  889.     @echo "Building a full distribution of this tree isn't done"
  890.     @echo "via 'make dist'.  Check out the etc/ subdirectory" 
  891.  
  892. etags tags: TAGS
  893.  
  894. TAGS:
  895.     etags `$(MAKE) ls`
  896.  
  897. ls:
  898.     @echo Makefile
  899.     @for i in $(SUBDIRS); \
  900.     do \
  901.         (cd $$i; \
  902.             pwd=`pwd`; \
  903.             wd=`basename $$pwd`; \
  904.             for j in `$(MAKE) ls`; \
  905.             do \
  906.                 echo $$wd/$$j; \
  907.             done) \
  908.     done
  909.  
  910. # with the gnu make, this is done automatically.
  911.  
  912. Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
  913.     $(SHELL) ./config.status
  914.  
  915. #
  916. # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
  917.  
  918. DEVO_SUPPORT= README Makefile.in configure configure.in \
  919.     config.guess config.sub config move-if-change
  920. ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
  921.     configure.texi
  922. GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob sim
  923. GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS)
  924.  
  925. .PHONY: setup-dirs-gdb gdb.tar.Z make-gdb.tar.Z
  926. setup-dirs-gdb:
  927.     ./configure sun4
  928.     $(MAKE) clean
  929.     ./configure -rm sun4
  930.     chmod og=u `find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
  931.  
  932. gdb.tar.Z: setup-dirs-gdb
  933.     (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir BISON="byacc")
  934.     (cd gdb; $(MAKE) -f Makefile.in make-proto-testsuite.dir)
  935.     $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z
  936.  
  937. make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/texinfo.tex
  938.     rm -rf proto-toplev; mkdir proto-toplev
  939.     ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
  940.     (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
  941.         ln -s ../$$i . ; \
  942.     done)
  943.     mkdir proto-toplev/etc
  944.     (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
  945.         ln -s ../../etc/$$i . ; \
  946.     done)
  947.     # Put only one copy (four hard links) of COPYING in the tar file.
  948.     rm                          proto-toplev/bfd/COPYING
  949.     ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
  950.     rm                          proto-toplev/include/COPYING
  951.     ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
  952.     rm                          proto-toplev/readline/COPYING
  953.     ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
  954.  
  955.     # Take out texinfo and glob from configurable dirs
  956.     rm proto-toplev/configure.in
  957.     sed -e '/^host_tools=/s/texinfo //' \
  958.         -e '/^host_libs=/s/glob //' \
  959.         <configure.in >proto-toplev/configure.in
  960.  
  961.     # Take out texinfo from a few places; make simple BISON=bison line.
  962.     rm proto-toplev/Makefile.in
  963.     sed -e '/^all\.normal: /s/\all-texinfo //' \
  964.         -e '/^    install-texinfo /d' \
  965.         -e '/^BISON = /,/^$$/d' \
  966.         -e '/^# BISON:/s/.*/BISON = bison -y/' \
  967.     <Makefile.in >proto-toplev/Makefile.in
  968.  
  969.     mkdir proto-toplev/texinfo
  970.     ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
  971.     ln -s ../../texinfo/tex3patch   proto-toplev/texinfo/
  972.     chmod og=u `find proto-toplev -print`
  973.     (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
  974.         ln -s proto-toplev gdb-$$VER; \
  975.         echo "==> Making gdb-$$VER.tar.Z"; \
  976.         tar cfh - gdb-$$VER | $(COMPRESS) -v >gdb-$$VER.tar.Z; \
  977.         echo "==> Making gdb-$$VER.tar.z"; \
  978.         tar cfh - gdb-$$VER | $(GZIP) -v -9 >gdb-$$VER.tar.z)
  979.  
  980.     # Make the testsuite archive separately.
  981.     ln -s ../../gdb/proto-testsuite.dir/testsuite proto-toplev/gdb/testsuite
  982.     # Blow away the Chill test that requires a Chill compiled executable,
  983.     # since GNU Chill is not yet publically available.
  984.     rm -rf proto-toplev/gdb/testsuite/gdb.t31
  985.  
  986.     # Put a copy of COPYING in the tar file.
  987.     ln proto-toplev/gdb/COPYING proto-toplev/gdb/testsuite/COPYING
  988.     chmod og=u `find proto-toplev/gdb/testsuite -print`
  989.     (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
  990.         echo "==> Making gdb-$$VER-testsuite.tar.Z"; \
  991.         tar cfh - gdb-$$VER/configure gdb-$$VER/config.guess \
  992.             gdb-$$VER/config.sub gdb-$$VER/move-if-change \
  993.             gdb-$$VER/gdb/testsuite | \
  994.             $(COMPRESS) -v >gdb-$$VER-testsuite.tar.Z; \
  995.         echo "==> Making gdb-$$VER-testsuite.tar.z"; \
  996.         tar cfh - gdb-$$VER/configure gdb-$$VER/config.guess \
  997.             gdb-$$VER/config.sub gdb-$$VER/move-if-change \
  998.             gdb-$$VER/gdb/testsuite | \
  999.             $(GZIP) -v -9 >gdb-$$VER-testsuite.tar.z)
  1000.  
  1001. # When you use `make setup-dirs' or `make taz' you should always redefine
  1002. # this macro.
  1003. SUPPORT_FILES = list-of-support-files-for-tool-in-question
  1004. # Directories that might want `make proto-dir' run.
  1005. PROTODIRS= gdb
  1006.  
  1007. .PHONY: taz
  1008.  
  1009. taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex texinfo/gpl.texinfo
  1010.     ./configure sun4
  1011.     $(MAKE) clean
  1012.     ./configure -rm sun4
  1013.     chmod og=u `find etc $(DEVO_SUPPORT) $(SUPPORT_FILES) -print`
  1014.     # Make links, and run "proto-dir" stuff when needed.
  1015.     # The `echo' for setting `p' is to convert all whitespace to spaces.
  1016.     # Then the `case' further below should tell whether $$d is in
  1017.     # PROTODIRS.
  1018.     rm -rf proto-toplev ; mkdir proto-toplev
  1019.     dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
  1020.     p=" `echo $(PROTODIRS)` " ; \
  1021.     for d in $$dirs ; do \
  1022.       if [ -d $$d ]; then \
  1023.         case " $(PROTODIRS) " in \
  1024.         "* $$d *")    (cd $$d ; $(MAKE) -f Makefile.in proto-dir) ; \
  1025.             ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ;; \
  1026.         *)        ln -s ../$$d proto-toplev/$$d ;; \
  1027.         esac ; \
  1028.       else ln -s ../$$d proto-toplev/$$d ; fi ; \
  1029.     done
  1030.     #
  1031.     mkdir proto-toplev/etc
  1032.     (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
  1033.         ln -s ../../etc/$$i . ; \
  1034.     done)
  1035.     #
  1036.     # Take out texinfo and glob from configurable dirs
  1037.     rm proto-toplev/configure.in
  1038.     sed -e '/^host_tools=/s/texinfo //' \
  1039.         -e '/^host_libs=/s/glob //' \
  1040.         <configure.in >proto-toplev/configure.in
  1041.     #
  1042.     # Take out texinfo from a few places; make simple BISON=bison line.
  1043.     rm proto-toplev/Makefile.in
  1044.     sed -e '/^all\.normal: /s/\all-texinfo //' \
  1045.         -e '/^    install-texinfo /d' \
  1046.         -e '/^BISON = /,/^$$/d' \
  1047.         -e '/^# BISON:/s/.*/BISON = bison -y/' \
  1048.     <Makefile.in >proto-toplev/Makefile.in
  1049.     #
  1050.     mkdir proto-toplev/texinfo
  1051.     ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
  1052.     ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
  1053.     ln -s ../../texinfo/tex3patch   proto-toplev/texinfo/
  1054.     chmod og=u `find proto-toplev -print`
  1055.     (VER=`sed <$(TOOL)/Makefile.in -n 's/VERSION *= *//p'`; \
  1056.         echo "==> Making $(TOOL)-$$VER.tar.z"; \
  1057.         ln -s proto-toplev $(TOOL)-$$VER; \
  1058.         tar cfh - $(TOOL)-$$VER \
  1059.         | $(GZIP) -v >$(TOOL)-$$VER.tar.z)
  1060.  
  1061. GAS_SUPPORT_DIRS= bfd include libiberty opcodes
  1062.  
  1063. .PHONY: gas.tar.z
  1064. gas.tar.z: $(DEVO_SUPPORT) $(GAS_SUPPORT_DIRS) gas \
  1065.         texinfo/texinfo.tex texinfo/gpl.texinfo
  1066.     $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" TOOL=gas
  1067.  
  1068. .PHONY: gas+binutils.tar.z
  1069. GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
  1070. gas+binutils.tar.z: $(DEVO_SUPPORT) $(GASB_SUPPORT_DIRS) gas \
  1071.         texinfo/texinfo.tex texinfo/gpl.texinfo
  1072.     $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(GASB_SUPPORT_DIRS)" TOOL=gas
  1073.  
  1074. .NOEXPORT:
  1075. MAKEOVERRIDES=
  1076.  
  1077.  
  1078. # end of Makefile.in
  1079.